package com.example.administrator.ygddriver.liteorm;

import android.content.Context;

import com.litesuits.orm.LiteOrm;

/**
 * Created by Administrator on 2016/11/4.
 */
public class SingleLiteOrm {
    private static SingleLiteOrm singleLiteOrm;
    private LiteOrm liteOrm;

    private SingleLiteOrm(Context context) {
        liteOrm = LiteOrm.newSingleInstance(context, "com.example.administrator.ygd");
    }

    public LiteOrm SingleLite() {
        return liteOrm;
    }

    public static SingleLiteOrm getSingleLiteOrm(Context context) {
        if (singleLiteOrm == null) {
            synchronized (SingleLiteOrm.class) {
                if (singleLiteOrm == null) {
                    singleLiteOrm = new SingleLiteOrm(context);
                }
            }
        }
        return singleLiteOrm;
    }
}
